import base64


def convert_to_base64(image_path):
    with open(image_path, "rb") as image_file:
        return base64.b64encode(image_file.read()).decode('utf-8')


def is_image_file(file_name):
    # 检查文件扩展名是否为常见的图像格式
    image_extensions = ['.jpg', '.jpeg', '.png']
    return any(file_name.lower().endswith(ext) for ext in image_extensions)
